﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TMDT_Nhom1A.BUS;
using TMDT_Nhom1A.DTO;
namespace TMDT_Nhom1A.UserControl_Admin
{
    public partial class DanhSachNhomSanPham_Admin : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                rplistkeycatalogue.DataSource = ParentCatalogue_BUS.ListKeyCatalogue();
                rplistkeycatalogue.DataBind();
            }
        }

        protected void rplistkeycatalogue_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            Label parentcataloguekey = (Label)e.Item.FindControl("keycatalogueid");
            Repeater rplistcatalogue = (Repeater)e.Item.FindControl("rplistcatalogue");
            rplistcatalogue.DataSource = ChildCatalogue_BUS.ListCatalogue(int.Parse(parentcataloguekey.Text));
            rplistcatalogue.DataBind();
        }    
    }
}